import React from "react";
import ClassNames from "classnames";
import { FontAwesomeIcon, FontAwesomeIconProps } from "@fortawesome/react-fontawesome";

type ThemeType = "primary" | "danger"

export interface IconProps extends FontAwesomeIconProps {
    theme: ThemeType;
}


export const Icon:React.FC<IconProps> = (props) => {
    const {theme , className, ...restProps } = props;
    const classname = ClassNames('icon', className , {
        [`icon-${theme}`]:theme
    })

    return (
        <FontAwesomeIcon className={classname} {...restProps}></FontAwesomeIcon>
    )

}

export default Icon